import { PageHeader, Tag, Button,Popconfirm, message,} from 'antd';
import React, { Component } from 'react';
import copy from "copy-to-clipboard";  

class Head extends Component {
    constructor() {  
        super();  
        this.state = {  
            textToCopy: "Copy to Clipboard Demo!",
            };  
            this.handleInputChange = this.handleInputChange.bind(this);  
            this.Copytext = this.Copytext.bind(this);  
    }

    handleInputChange(e) {
        this.setState({
            textToCopy: e.target.value,
        });
    }
    Copytext() {  
        copy(this.state.textToCopy);
    } 
confirm(){
     
    copy("1038262047");  
}
cancel()
    {
    copy("981566412"); 
    }
    render() {
        return (
            <>
                <PageHeader
                    tags={<Tag color="blue">Running</Tag>}
                    subTitle="服务器运行状态"
                    extra={[
                        <Popconfirm placement="bottom" title="复制群号到剪切板" onConfirm={this.confirm} onCancel={this.cancel} okText="纯净服" cancelText="模组服">
                            <Button type="primary">加入我们</Button>
                        </Popconfirm>
                    ]}
                >
                </PageHeader>
            </>
            

        )
    }
}

export default Head;